<template>
  <!-- 日间透支计息扣款通知查询明细页面弹出框-->
  <el-dialog
    title="日间透支计息扣款通知查询明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="180px" :disabled="true">
      <el-row>
        <el-col :span="12">
          <el-form-item label="交易流水号：" prop="id">
            <el-input v-model="formData.id" placeholder="交易流水号" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="报文标识号：" prop="pkgId">
            <el-input v-model="formData.pkgId" placeholder="报文标识号" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="系统编号：" prop="sysCode">
            <el-select v-model="formData.sysCode" placeholder="请选择" style="width: 100%">
              <el-option
                v-for="dict in dictMap.SYSTEMCODE"
                :key="dict.value"
                :label="`${dict.value}-${dict.text}`"
                :value="dict.value"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="工作日期：" prop="workdate">
            <el-date-picker
              v-model="formData.workdate"
              type="date"
              value-format="yyyyMMdd"
              placeholder="选择日期"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="扣息清算行行号：" prop="distrStBrno">
            <el-input v-model="formData.distrStBrno" placeholder="扣息清算行行号" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="扣息清算行名称：" prop="distrStBrnoname">
            <el-input v-model="formData.distrStBrnoname" placeholder="扣息清算行名称" />
          </el-form-item>
        </el-col>
      </el-row>

      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="计息时点个数：" prop="intNum">
            <el-input v-model="formData.intNum" placeholder="计息时点个数" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="透支利息合计币种：" prop="intTotalCurcd">
            <el-input v-model="formData.intTotalCurcd" placeholder="透支利息合计币种" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row type="flex">
        <el-col :span="12">
          <el-form-item label="透支利息合计：" prop="intTotAmt">
            <el-input v-model="formData.intTotAmt" placeholder="透支利息合计" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="报文接收时间：" prop="rcvTime">
            <el-date-picker
              v-model="formData.rcvTime"
              type="datetime"
              value-format="yyyyMMddHHmmss"
              placeholder="选择时间"
              style="width: 100%"
            ></el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div style="height: 300px; margin-bottom: 20px">
      <ht-table
        ref="flowTable"
        :showSerialNumber="false"
        :multi-select="false"
        :dictMap="dictMap"
        :reqConfig="reqConfig"
        :queryParams="queryParams"
        :tableBindColumns="tableBindColumns"
        :opButtonList="opButtonList"
        :randomRowKey="true"
        :initData="false"
        defaultEventKey="flowTable"
        style="height: 100%"
      ></ht-table>
    </div>
  </el-dialog>
</template>
<script>
import { detailTabSearch } from "@/api/cnaps/saps/otherCommQuery/daytime_overdraft_query.js";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
export default {
  name: "DaytimeDetails",
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      detailsData: null, // 明细操作传值
      // 是否显示弹出层
      open: false,
      reqConfig: detailTabSearch,
      // 查询参数
      queryParams: {
        id: "",
      },
      opButtonList: () => {
        return [];
      },
      tableBindColumns: [
        {
          label: `透支金额币种`,
          prop: "overdrftAmountCurcd",
          align: "center",
          sortable: false,
          width: "150",
        },
        {
          label: `透支金额`,
          prop: "overdrftAmount",
          align: "center",
          sortable: false,
          type: "price",
        },
        {
          label: `透支利息币种`,
          prop: "intAmountCurcd",
          align: "center",
          sortable: false,
          width: "150",
        },
        {
          label: `透支利息`,
          prop: "intAmt",
          align: "center",
          sortable: false,
          type: "price",
        },
        {
          label: `利率`,
          prop: "intRate",
          align: "center",
          sortable: false,
        },
        {
          label: `计息时点`,
          prop: "toDatetime",
          width: "160",
          sortable: false,
          type: "date",
        },
      ],
    };
  },
  mounted() {},
  watch: {
    open(d) {
      if (d) {
        this.$nextTick(() => {
          if (this.formData && this.formData.id) {
            this.$set(this.queryParams, "id", this.formData.id);
            this.$refs.flowTable.doQuery();
          }
        });
      }
    },
  },
  methods: {
    // 表单重置
    reset() {
      this.resetForm("detailsForm");
      // this.$set(this, "form", {});
    },
    closeFn() {
      this.open = false;
      this.reset();
    },
    show() {
      this.open = true;
    },
  },
};
</script>
<style lang="scss" scoped>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
